#include <gtk/gtk.h>
#include <unistd.h>
+#include <math.h>
#define VIEW_WIDTH 320
#define VIEW_HEIGHT 240
static enum Pos
get_pos_from_path (GtkTreeView *tree_view,
GtkTreePath *path,
- gint row_height,
+ gdouble row_height,
GtkAdjustment *vadj)
{
int row_start;
enum Pos pos,
gint row_y,
gint row_start,
- gint row_height,
+ gdouble row_height,
gdouble row_align)
{
gboolean passed = TRUE;
* (ie. the row's center is at the
* center of the view).
*/
- if (row_y != (int)(vadj->page_size / 2 - row_height / 2))
+ gdouble middle = vadj->page_size / 2 - row_height / 2;
+ if (row_y != ceil (middle) && row_y != floor (middle))
passed = FALSE;
}
break;
static gboolean
test_position_without_align (GtkTreeView *tree_view,
- gint row_start,
- gint row_height)
+ gdouble row_start,
+ gdouble row_height)
{
GtkAdjustment *vadj = gtk_tree_view_get_vadjustment (tree_view);